<?php
@header('Content-type: text/html;charset=UTF-8');
include '../../include/config.php';

require_once ('ly_check.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数据日报表</title>
<link rel="stylesheet" href="../images/css.css" type="text/css" />
<style type="text/css">
* {
	margin: 0;
	padding: 0;
}

.btn {
	background: none repeat scroll 0 0 rgb(2, 114, 188);
	border: medium none;
	cursor: pointer;
	height: 40px;
	margin: 5px 20px 0 0;;
	width: 100px;
	color: #fff;
	font-family: "微软雅黑";
	font-size: 16px;
	border-radius: 5px;
}
</style>
<script src="js/echarts/echarts.js"></script>
<script src="js/BarChart.js"></script>
<script src="../../front/js/jquery.min.js"></script>

<script type="text/javascript">  
    initDrawStdBar();
    var datatime=new Date();
	$(function(){ 
		$.ajax({
			url:'reportData.php?type=TopBar',
			type:'get',
			datatype:'json',
			success:function(data){
				DrawTopBar(data);
			}
		});
		$.ajax({
			url:'reportData.php?type=BottomBar',
			type:'get',
			datatype:'json',
			success:function(data){
				DrawBottomBar(data);
			}
		});
		$.ajax({
			url:'reportData.php?type=TopPie',
			type:'get',
			datatype:'json',
			success:function(data){
				DrawTopPie(data);
			}
		});
		$.ajax({
			url:'reportData.php?type=BottomPie',
			type:'get',
			datatype:'json',
			success:function(data){
				DrawBottomPie(data);
			}
		});
		$.ajax({
			url:'reportData.php?type=Line',
			type:'get',
			datatype:'json',
			success:function(data){
				DrawLine(data);
			}
		});
		$("#reportDiv").width($(document.body)[0].clientWidth-50);
		$('#enter').bind("click", function() {
			var docElm = document.documentElement;
			if(docElm.requestFullscreen) { 
				docElm.requestFullscreen(); 
			} else if(docElm.msRequestFullscreen) { 
				docElm.msRequestFullscreen(); 
			} else if(docElm.mozRequestFullScreen) { 
				docElm.mozRequestFullScreen(); 
			} else if(docElm.webkitRequestFullScreen) { 
				docElm.webkitRequestFullScreen(); 
			}
		});
		$('#cancel').bind("click", function() {
			var docElm = document.documentElement;
			if(document.exitFullscreen) {
				document.exitFullscreen();
			} else if(document.msExitFullscreen) {
				document.msExitFullscreen();
			} else if(document.mozCancelFullScreen) {
				document.mozCancelFullScreen();
			} else if(document.webkitCancelFullScreen) {
				document.webkitCancelFullScreen();
			}
		});
	});
	function DrawTopBar(data){
		var legend = [""];//图例
		var title = "电商上行分类数据分布图（"+datatime.getFullYear()+"）    单位：万元";//主标题
		var subtitle = "";//副标题
		var divID = "main_1";//div ID
                debugger;
		DrawStdBar(eval('('+data+')'), divID, legend, title, subtitle,0);
	}
	function DrawBottomBar(data){
		var legend = [""];//图例
		var title = "电商下行分类数据分布图（"+datatime.getFullYear()+"）    单位：万元";//主标题
		var subtitle = "";//副标题
		var divID = "main_2";//div ID
		DrawStdBar(eval('('+data+')'), divID, legend, title, subtitle,1);
	}
	function DrawTopPie(data){
		var legend = [""];//图例
		var title = "电商服务网点上行实时分布图（"+datatime.getFullYear()+"）    单位：万元";//主标题
		var subtitle = "";//副标题
		var divID = "main_3";//div ID
		DrawStdPie(eval('('+data+')'), divID, legend, title, subtitle,0);
	} 
	function DrawBottomPie(data){
		var legend = [""];//图例
		var title = "电商服务网点下行实时分布图（"+datatime.getFullYear()+"）    单位：万元";//主标题
		var subtitle = "";//副标题
		var divID = "main_4";//div ID
		DrawStdPie(eval('('+data+')'), divID, legend, title, subtitle,0);
	} 
	function DrawLine(data){
		var legend = [""];//图例
		var title = "电商上下行实时走势（"+datatime.getFullYear()+"）";//主标题
		var subtitle = "";//副标题
		var divID = "main_5";//div ID
		DrawStdLine(eval('('+data+')'), divID, legend, title, subtitle);
	} 
</script>

</head>
<body>
        <div id="msg"></div>
	<div style="float: right">
                <button class="btn" target="_blank" onclick="window.open('rtdata.php')">实时数据</button>
		<button class="btn" id="enter">全屏模式</button>
		<button class="btn" id="cancel">退出全屏</button>
	</div>
	<div id="reportDiv" style="height: 400px; margin: 20px auto;">
		<div id="main_5"
			style="height: 200px; width: 100%; padding: 0px; margin: 0px; float: left;"></div>
		<div id="main_1"
			style="height: 300px; width: 50%; padding: 0px; margin: 0px; float: left;"></div>
		<div id="main_2"
			style="height: 300px; width: 50%; padding: 0px; margin: 0px; float: left;"></div>
		<div id="main_3"
			style="height: 100%; width: 50%; padding: 0px; margin: 0px;float: left;"></div>
		<div id="main_4"
			style="height: 100%; width: 50%; padding: 0px; margin: 0px; float: left;"></div>

	</div>
</body>
</html>